import QtQuick
import QtQuick.Controls
import QtQuick.Layouts

Item {
    id: io_MonitorBack
    width: 1820
    height: 980

    // Rectangle{
    //     anchors.fill: parent
    //     color: "gold"

    //     Text{
    //         anchors.centerIn: parent
    //         font.pixelSize: 50
    //         font.bold: true
    //         text: qsTr("监控界面")
    //     }
    // }

    property int io_CurrentPage: 1

    Component.onCompleted: {
        ioMonitorLoader.source = "IO_Monitor_InputSignals.qml"
    }

    Row{
        anchors.top: io_MonitorBack.top
        anchors.topMargin: 10
        anchors.left: io_MonitorBack.left
        anchors.leftMargin: 10
        spacing: 10

        A_Button{
            buttonWidth: 120
            buttonHeight: 50
            contentText_Data: qsTr("输入信号")
            isSelected: io_CurrentPage === 1
            onButtonClicked: {
                io_CurrentPage = 1
                ioMonitorLoader.source = "IO_Monitor_InputSignals.qml"
            }
        }

        A_Button{
            buttonWidth: 120
            buttonHeight: 50
            contentText_Data: qsTr("输出信号")
            isSelected: io_CurrentPage === 2
            onButtonClicked: {
                io_CurrentPage = 2
                ioMonitorLoader.source = "IO_Monitor_OutputSignals.qml"
            }
        }

    }

    Loader{
        id: ioMonitorLoader
        anchors.top: io_MonitorBack.top
        anchors.topMargin: 70
        anchors.left: io_MonitorBack.left
        // anchors.leftMargin: 95
        onSourceChanged: {
            console.log("已加载: "+ source)
        }

    }

}
